import com.sun.org.apache.xerces.internal.impl.xs.SchemaNamespaceSupport;

import java.util.Arrays;
import java.util.Scanner;

public class Test7 {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        int n = input.nextInt();
        int count = 0;
        int[] sum = new int[n];
        int[] arr = new int[n];
        int s = 0;
        int i = 0;
        for (i = 0; i < arr.length; i++) {
            arr[i] = input.nextInt();
        }
        for (i = 0; i < arr.length; i++) {
            count = 1;
            for (int j = 0; j < arr.length; j++) {
                if((arr[j] == arr[i]) && (i != j)) {
                    count++;
                }
            }
            if(count >= n/2) {
                sum[s] = count;
                s++;
            }
        }
        int maxIndex = 0;
        int max = sum[0];
        for (i = 1; i < sum.length; i++) {
            if(sum[i] > max) {
                max = sum[i];
                maxIndex = i;
            }
        }
        System.out.println("多数元素为:" + arr[maxIndex]);
    }
}
